<%@ page language="java" import="logic.*,java.util.*,utils.*, data.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SOS PLANET - Ayuda al mundo</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div id="wrapper">
<div class="content">
<div id="header">
	<%@ include file = "includes/header.jsp" %>
</div><!-- header -->

<div id="menu">      
	<%@ include file = "includes/menu.html" %>
</div><!-- menu -->
           
<%

String idDonnor = request.getParameter("iddonnor");
String idCategory = request.getParameter("category");
String idDestination = request.getParameter("destiny");
String name = request.getParameter("name");
String description = request.getParameter("description");
float price = Float.parseFloat(request.getParameter("price"));
System.out.print("\n"+idDestination+"\n");
System.out.println(idDonnor);
Product p = new Product(idCategory,name,description,price,idDonnor,idDestination);
CalculateRatio r = new CalculateRatio();
System.out.println(p.getCategory());
Validate v = new Validate();
v.putDonatation(p, idDonnor, idDestination);

if (p.getRatio() > 0.8){
    %><h3>El producto ha sido donado correctamente, pronto aparecera en el catalogo</h3><% 
	}else if(p.getRatio()> 0.1){
	%><h3>El administrador evaluara su producto</h3><%
		}else{
			%><h3>El producto ha sido rechazado</h3><%
		}
%>

<div id="footer">
	<%@ include file = "includes/footer.html" %>
</div><!--footer-->

</div><!--content-->
</div><!--wrapper-->
</body>
</html>